#include <math.h>
#include <iostream>
#include <conio.h>
using namespace std;
int main() {
int m,d;
cout<<"Input Day:\n";
cin>>d;
cout<<"Input Month:\n";
cin>>m;

switch (m) {
case 1:case 5:case 8:case 9:case 11:
    if(d==1){m=m-1;d=31;} else d=d-1;
    break;
case 2:case 4:case 6:case 7:case 10:case 12 :
    if(d==1){m=m-1;d=30;} else d=d-1;
    break;
case 3:
    if(d==1){m=m-1;d=28;} else d=d-1;
    break;
default:cout<<"error!!!";
    break;
}
cout<<"m="<<m<<"D="<<d<<"\n";
system("pause");
}
